package br.kld.kisaude.utils;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

@SuppressWarnings({ "deprecation", "unused" })
public class HibernateUtil {

	private static final SessionFactory sessionFactory;

	static {

		try {

			sessionFactory = new AnnotationConfiguration().configure()
					.buildSessionFactory();

			Session s = sessionFactory.openSession();

		} catch (Throwable ex) {
			throw new ExceptionInInitializerError(ex);
		}
	}

	public static SessionFactory getSessionFactory() {
		return sessionFactory;
	}

}
